/*
 *  Strategy005.cpp
 *  StrategyInspector
 *
 *  Created by jiro on 12/08/09.
 *  Copyright 2012 jiro music. All rights reserved.
 *
 */

#include "Strategy005.h"

#include "../Commons.h"
#include "FxBasicParameter.h"
#include "StrategyParameterSet005.h"

StrategyPerfomance Strategy005::inspect( const StrategyParameterSet& param )
{
	return StrategyPerfomance();
}
	
int Strategy005::getStrategyIndex() const
{
	return 5;
}

StrategyParameterSet* Strategy005::createParameterSet( FxInvestmentBasicParameterSet* basicParam, NSDate* startDate, NSDate* endDate ) const
{
	FxBasicParameter p( basicParam->getCurrencyCode(), basicParam->getTargetCurrencyCode(), basicParam->getCharge(), basicParam->getSpread() );

	StrategyDoubleParameter targetExchangeRateGap;
	StrategyDoubleParameter lossCutExchangeRateGap;
	if ( [ basicParam->getCurrencyCode() isEqualToString: kText_JPY ] )
	{
		targetExchangeRateGap = StrategyDoubleParameter( 0.10, 1.5, 0.05 );
		lossCutExchangeRateGap = StrategyDoubleParameter( 0.10, 1.5, 0.05 );
	}
	else
	{
		targetExchangeRateGap = StrategyDoubleParameter( 0.0010, 0.015, 0.0005 );
		lossCutExchangeRateGap = StrategyDoubleParameter( 0.0010, 0.015, 0.0005 );
	}
	StrategyDoubleParameter shortTermMaLength = StrategyDoubleParameter( 3, 5, 1 );
	StrategyDoubleParameter middleTermMaLength = StrategyDoubleParameter( 15, 25, 1 );
	StrategyDoubleParameter timeUnitSec = StrategyDoubleParameter( 6 * secondsForOneHour, secondsForOneDay, 6 * secondsForOneHour );

	StrategyParameterSet005* s = new StrategyParameterSet005(
		p,
		startDate,
		endDate,
		targetExchangeRateGap,
		lossCutExchangeRateGap,
		shortTermMaLength,
		middleTermMaLength,
		timeUnitSec );
	return s;
}
